//
//  PermissionHelper.m
//  uteped_sdk
//
//  Created by Dapeng Wu on 2024/3/8.
//


#import "PermissionHelper.h"


@implementation PermissionHelper

static PermissionHelper *instance = nil;

+ (PermissionHelper*) shareInstance 
{
    if (instance == nil) {
        instance = [[PermissionHelper alloc] init];
    }
    return instance;
}

- (void)requestAuthorizationForCamera {
    AVAuthorizationStatus status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
    if (status == AVAuthorizationStatusRestricted || status == AVAuthorizationStatusDenied)
    {
         // 无权限
         // do something...
    }
}

- (AVAuthorizationStatus)canUseCamera {
    AVAuthorizationStatus status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
    if (status == AVAuthorizationStatusRestricted || status == AVAuthorizationStatusDenied)
    {
         // 无权限
         // do something...
    }
    return status;
}

@end

